import wx

metric = 'Binary/2'

class Fenetre(wx.Frame):
    def __init__(self, parent, title, pos=(100,100), size=(500,300)):
        wx.Frame.__init__(self, parent, id=-1, title=title, pos=pos, size=size)
        self.panel = wx.Panel(self)
        self.panel.SetBackgroundColour("#FFFFFF")

        self.onOffText = wx.StaticText(self.panel, id=-1, label="Audio", pos=(28,10), size=wx.DefaultSize)
        self.onOff = wx.ToggleButton(self.panel, id=-1, label="On/Off", pos=(10,28), size=wx.DefaultSize)
        self.onOff.Bind(wx.EVT_TOGGLEBUTTON, self.handleOnOff)
        
        self.metricChoice = ['Binary/2', 'Binary/4', 'Binary/8', 'Binary/16', 'Ternary/2', 'Ternary/4', 'Ternary/8', 'Ternary/16']  
        self.metricText = wx.StaticText(self.panel, id=-1, label="Metric", pos=(105,10), size=wx.DefaultSize)
        self.metric = wx.Choice(self.panel, id=-1, pos=(95,27), size=wx.DefaultSize, choices=self.metricChoice)
        self.metric.Bind(wx.EVT_CHOICE, self.handleMetric)
        
        self.randGenText = wx.StaticText(self.panel, id=-1, label="Random Rythme", pos=(225,10), size=wx.DefaultSize)
        self.randGen = wx.Button(self.panel, id=-1, label='Generator', pos=(230,27), size=wx.DefaultSize)
        self.randGen.Bind(wx.EVT_BUTTON, self.handleRandGen)
        
#        self.Bind(wx.EVT_PAINT, RythmBox)
        
    def handleRandGen(self, evt):
        print 2
        
    def handleMetric(self, evt):
        global metric
        metric = evt.GetString()
        print metric

    def handleOnOff(self, evt):
        print evt.GetInt()
        
#    def RythmBox(self, evt):    
#        w,h = Fenetre.GetSize()
#        dc = wx.AutoBufferedPaintDC(self)
#        dc.DrawRectangle(0, 0, w, h)

app = wx.PySimpleApp()

mainFrame = Fenetre(None, title='Harmonic-Player')
mainFrame.Show()

app.MainLoop()